This ensures that we can still match accelerators for the window even
if no widget currently has focus.
if (window->priv->application)
{
- GtkWidget *focused_widget = gtk_window_get_focus (window);
- if (focused_widget == NULL)
- return FALSE;
- GtkActionMuxer *muxer = _gtk_widget_get_action_muxer (focused_widget, FALSE);
+ GtkWidget *focused_widget;
+ GtkActionMuxer *muxer;
+
+ focused_widget = gtk_window_get_focus (window);
+
+ if (focused_widget)
+ muxer = _gtk_widget_get_action_muxer (focused_widget, FALSE);
+ else
+ muxer = _gtk_widget_get_action_muxer (GTK_WIDGET (window), FALSE);
+
if (muxer == NULL)
return FALSE;